#ifndef MABSTRACTSTATE_HPP
#define MABSTRACTSTATE_HPP

#include <SDL2/SDL.h>

namespace MA {

class Application;

class AbstractState {

public:
	AbstractState();
	~AbstractState();

	virtual void bindApp(Application* app);

	virtual void handleEvent();
	virtual void updateLogic() = 0;
	virtual void updateRender() = 0;

protected:
	virtual void onKeyDown(SDL_Keycode keycode) {}
	virtual void onKeyUp(SDL_Keycode keycode) {}
	virtual void onMouseDown(uint8_t buttonIndex, int32_t mousePosX, int32_t mousePosY) {}
	virtual void onMouseUp(uint8_t buttonIndex, int32_t mousePosX, int32_t mousePosY) {}
	virtual void onMouseMotion(SDL_MouseMotionEvent motion) {}

	virtual void onDefault(SDL_Event event) {}

	Application* m_app;
};

}
#endif // MABSTRACTSTATE_HPP
